<?php
/**
 * @see Alinks_Keyphrase_Interface
 */
require_once('Alinks/Keyphrase/Interface.php');

/**
 * @see Alinks_Cacher_Interface
 */
require_once('Alinks/Cacher/Interface.php');

/**
 * @see Alinks_Factory_Abstract
 */
require_once('Alinks/Factory/Interface.php');

/**
 * Interface for post parsing classes
 *
 * Copyright (C) 2008  Sean Hickey
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Sean Hickey <sean@headzoo.com>
 * @version $Id: Interface.php 405 2008-07-05 11:56:19Z sean $
 * @package Alinks_Post
 */
interface Alinks_Post_Parser_Interface
{
	/**
	 * Sets the keyphrases that are going be parsed in the content
	 *
	 * @param Alinks_Keyphrase_Abstract[] $keyphrases The keyphrases
	 * @return Alinks_Post_Parser_Interface
	 */
	function setKeyphrases(array $keyphrases);
	
	/**
	 * Sets the installed factories
	 *
	 * @param Alinks_Factory_Interface[] $factories The factories
	 * @return Alinks_Post_Parser_Interface
	 */
	function setFactories(array $factories);
	
	/**
	 * Adds a keyphrase that to be parsed in the content
	 *
	 * @param Alinks_Keyphrase_Interface $keyphrase The keyphrase
	 * @return Alinks_Post_Parser_Interface
	 */
	function addKeyphrase(Alinks_Keyphrase_Interface $keyphrase);
	
	/**
	 * Adds a factory to parse the content
	 *
	 * @param Alinks_Factory_Interface $factory The factory
	 * @return Alinks_Post_Parser_Interface
	 */
	function addFactory(Alinks_Factory_Interface $factory);
	
	/**
	 * Sets the Alinks_Cacher_Interface that will be used to cache parsed
	 * content
	 *
	 * @param Alinks_Cacher_Interface $cacher
	 * @return Alinks_Post_Parser_Interface
	 */
	function setCacher(Alinks_Cacher_Interface $cacher);
	
	/**
	 * Sets an instance of Alinks_LinkBuilder_Interface for building links
	 *
	 * @param Alinks_LinkBuilder_Interface $link_builder The link builder
	 * @return Alinks_Post_Parser_Interface
	 */
	function setLinkBuilder(Alinks_LinkBuilder_Interface $link_builder);
	
	/**
	 * Sets the aLinks settings
	 *
	 * @param array $settings The aLinks related user settings
	 * @return Alinks_Post_Parser_Interface
	 */
	function setSettings(array $settings);
	
	/**
	 * Returns the set Alinks_Cacher_Interface instance
	 *
	 * @return Alinks_Cacher_Interface
	 */
	function getCacher();
	
	/**
	 * Returns the keyphrases
	 *
	 * @return Alinks_Keyphrase_Abstract[]
	 */
	function getKeyphrases();
	
	/**
	 * Returns the set factories
	 *
	 * @return Alinks_Factory_Abstract[]
	 */
	function getFactories();
	
	/**
	 * Returns the link builder instance
	 *
	 * @return Alinks_LinkBuilder_Interface
	 */
	function getLinkBuilder();
	
	/**
	 * Returns the set settings
	 *
	 * @return array
	 */
	function getSettings();
	
	/**
	 * Parses post content
	 *
	 * Replaces key phrases found in $content with links.
	 *
	 * @param string $content The content to parse
	 * @return string
	 */
	function parse($content);
}